/*
 * @Author: author
 * @Date:   2020-08-23 22:08:22
 * @Last Modified by:   Development
 * @Last Modified time: 2020-08-24 23:42:56
 */
import { IMethod } from '@/server/model'

/** 通用 API 类型定义 */
export interface IReqApi {
  title: string
  method: keyof IMethod
  path: string
  prefix: '' | 'api'
  version: '' | 'applets'
}

/** 请求数据 */
export interface IReq {
  pageNum: number
  pageSize: number
}

/**
 * 请求数据带订单号
 */
export interface IReqOrderSn {
  appletsOrderSn: string
}

/** 后台响应数据 */
export interface IRes {
  result: number
  message: string
}

/** 响应 ==> data ==> 为 Boolean */
export interface IResBoolean extends IRes {
  data: boolean
}

/** 响应 ==> data ==> 为 Object */
export interface IResObject<U> extends IRes {
  data: U
}

/** 响应 ==> data ==> 为  Array */
export interface IResArray<T> extends IRes {
  data: T[]
}

/** 响应 ==> data ==> 为  List */
export interface IResList<T> extends IRes {
  data: IResListData<T>
}

/** 响应列表 ==> Data 数据 */
export interface IResListData<T> {
  pageNum: number
  pageCount: number
  total: number
  list: T[]
}
